<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" indent="yes">

  <xsl:output encoding="us-ascii" method="html" omit-xml-declaration="yes" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>

  <xsl:variable name="xopus-js">../../../xopus/xopus.js</xsl:variable>
  <xsl:variable name="xopus-addon-script">xopus-config/demo-mode.js</xsl:variable>

  <xsl:template match="island">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="canvas">
    <html>
      <head>
        <title>Xopus for DITA</title>
        <link rel="stylesheet" type="text/css" href="../css/{ fileType }.css"/>
        <script type="text/javascript" src="{$xopus-js}"/>
      </head>
      <body>

        <div xopus="true">
          <xml>
            <x:config xmlns:x="http://www.xopus.com/xmlns/config" version="1.0">

              <x:pipeline xml="urn:xopus-dita-example:{ fileId }" xsd="{ schema }">
                <x:view name="docView">
                  <x:transform xsl="../xsl/prepareXIncludes.xsl"/>
                  <x:resolveXIncludes/>
                  <x:transform xsl="../xsl/{ fileType }.xsl"/>
                </x:view>
                <x:view name="xmlView">
                  <x:treeTransform/>
                </x:view>
              </x:pipeline>

              <!-- DITA Base support: -->
              <x:import src="../xopus-config/base/config.xml"/>
              <x:import src="../xopus-config/base/toolbar.xml"/>
              <x:javascript src="../xopus-config/base/toolbar-commands.js"/>

              <!-- DITA Learning support: -->
              <x:import src="../xopus-config/learning/config.xml"/>

              <!-- Example-app editor configuration files: -->
              <x:import src="xopus-config/local.xml"/>
              <x:javascript src="xopus-config/local.js"/>
              <x:javascript src="xopus-config/uuid.js"/>
              <xsl:if test="$xopus-addon-script">
                <x:javascript src="{ $xopus-addon-script }"/>
              </xsl:if>

              <x:changeTracking>
                <x:enabled>true</x:enabled>
              </x:changeTracking>

              <x:spellChecker>
                <x:defaultLanguage>en-us</x:defaultLanguage>
              </x:spellChecker>

            </x:config>
          </xml>
        </div>
      </body>
    </html>
  </xsl:template>

  <xsl:template match="empty">
    <html>
      <head>
        <title>Xopus for DITA</title>
        <link rel="stylesheet" type="text/css" href="../css/common.css"/>
        <link rel="stylesheet" type="text/css" href="ui/local-common.css"/>

        <script type="text/javascript" src="{$xopus-js}"/>
        <script type="text/javascript">
        <xsl:text disable-output-escaping="yes">
        function onLoadHandler()
        {
          if (parent.Editor &amp;&amp; parent.Editor.getExitFunction()) {
            parent.Editor.setExitFunction(null);
          }
          if (parent.parent.document.getElementById('navigation') &amp;&amp; 
              parent.parent.document.getElementById('navigation').contentWindow.MapNavigation) {
            parent.parent.document.getElementById('navigation').contentWindow.MapNavigation.clearSelection();
          }
        }
        </xsl:text>
        </script>
      </head>
      <body onload="onLoadHandler()">
        <div class="loaded-message">
          <p><strong>Welcome to the DITALabs online Demo</strong></p>
          <p>
          There is currently no document open.
          Choose one of the documents to the left to start editing.
          </p><br />
			<p>This demo has been loaded with the sample topics from the DITA OpenToolkit</p>
        </div>
      </body>
    </html>
  </xsl:template>

</xsl:stylesheet>
